package com.yisu.expressway.ewf.common.web;

import com.yisu.expressway.ewf.common.enums.ResponseCode;

/**
 * Created by LKL on 2016/1/26.
 */
public class JsonResult {
    private Integer errorCode;
    private String errorMessage;
    private Object data;

    public JsonResult(){
        this.errorCode = ResponseCode.SUCCESS.code;
        this.errorMessage = ResponseCode.SUCCESS.msg;
    }

    public JsonResult(Integer code, String msg) {
        this.errorCode = code;
        this.errorMessage = msg;
    }

    public JsonResult(Object data) {
        this.errorCode = ResponseCode.SUCCESS.code;
        this.errorMessage = ResponseCode.SUCCESS.msg;
        this.data = data;
    }

    public JsonResult(Integer code, String msg, Object data) {
        this.errorCode = code;
        this.errorMessage = msg;
        this.data = data;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "JsonResult{" +
                "errorCode=" + errorCode +
                ", errorMessage='" + errorMessage + '\'' +
                ", data=" + data +
                '}';
    }
}
